Skip to main content

CMSEditor

A world-class, LCARS-styled Markdown editor for the Valhalla CMS.
Supports drag-and-drop image embedding, instant preview, and seamless integration with the Media Library and MediaLink ACL system.

Features

  • Visual Markdown Editing: Edit markdown with live preview.
  • Drag-and-Drop Media Embedding: Drag images or files from the Media Library directly into the editor to auto-embed secure links.
  • Quick Upload: Instantly upload and embed files.
  • Content Metadata: Edit title, subtitle, author, release date, tags, and content type.
  • Responsive Design: Works beautifully on all devices.
  • LCARS Design: Styled to match the Valhalla LCARS dashboard.

Usage

import CMSEditor from "@valkyr_labs_com/components/CMS/CMSEditor";

<CMSEditor
content={contentData}
isEditing={true}
onSave={handleSave}
onCancel={handleCancel}
/>

Props

NameTypeDescription
contentContentData | nullThe content object to edit
isEditingbooleanWhether the editor is in editing mode
onSave(content: Partial<ContentData>) => voidCallback for saving content
onCancel() => voidCallback for canceling edit

Example

Screenshot coming soon. Use the live component story in the Component Library for an up-to-date preview.

Best Practices

  • Use with the CMSMediaLibrary for drag-and-drop embedding.
  • Use the CoolButton component for all actions.
  • Integrate with RTK Query and ThorAPI models for full type safety.